package com.luotao.test.netty;

import com.luotao.devp.base.socket.parser.JsonDispatcher;
import com.luotao.devp.base.utils.App;
import com.luotao.test.user.AccountService;
import com.luotao.test.user.TypeService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by IntelliJ IDEA.
 * User: luotao
 * Date: 12-5-29
 * Time: 20:10
 */
public class NettyServerStartup {
    public static void main(String[] args)throws Exception{
        ApplicationContext cpp = App.getApp("spring/app-socket.xml");
        ClassPathXmlApplicationContext xapp = (ClassPathXmlApplicationContext) cpp;
        xapp.start();
        xapp.getBean("nettyServer");
//        TypeService typeService = (TypeService) xapp.getBean("typeService");
//        System.out.println("typeService.getRandomNum() = " + typeService.getRandomNum());
//        AccountService accountService = (AccountService) xapp.getBean("accountService");
//        System.out.println("accountService.getScale() = " + accountService.getScale());

//        JsonDispatcher jsonDispatcher = (JsonDispatcher) xapp.getBean("jsonDispatch");
//        System.out.println("jsonDispatcher.getProcIndex() = " + jsonDispatcher.getProcIndex());
//        System.out.println("jsonDispatcher.getProcType() = " + jsonDispatcher.getProcType());

        Thread.sleep(1000*60*60*24);
    }
}
